type Route = {
  /**
   * Any valid URL path
   */
  path?: string;
  /**
   * A React component to render only when the location matches.
   */
  component?: string | (() => any);
  wrappers?: string[];
  /**
   * navigate to a new location
   */
  redirect?: string;
  /**
   * When true, the active class/style will only be applied if the location is matched exactly.
   */
  exact?: boolean;
  routes?: Route[];
  title?: string;
  name?: string;
  key?: string;
};

const WEB_NAME = '学生实训考勤管理系统';
const routes: Route[] = [
  {
    title: `${WEB_NAME}-文件未找到`,
    path: '/404',
    component: '@/pages/404',
    name: '404',
    key: '404',
  },
  {
    title: `${WEB_NAME}-未登录`,
    path: '/401',
    component: '@/pages/401',
    name: '401',
    key: '401',
  },
  {
    title: `${WEB_NAME}-系统登录`,
    path: '/',
    component: '@/pages/login',
    name: '系统登录',
    key: 'login',
  },
  /*管理员 */
  {
    path: '/Admin',
    component: '@/layouts/Admin/index',
    routes: [
      {
        title: `${WEB_NAME}-首页`,
        path: '/Admin/index',
        component: '@/pages/Admin/index',
        name: '首页',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-教师信息管理`,
        path: '/Admin/teacherManager',
        component: '@/pages/Admin/TeacherManager',
        name: '教师信息管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-学生信息管理`,
        path: '/Admin/studentManager',
        component: '@/pages/Admin/studentManager',
        name: '学生信息管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-学生信息管理`,
        path: '/Admin/studentManager/Allstudents',
        component: '@/pages/Admin/studentManager/Allstudents',
        name: '学生信息管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-管理员修改密码`,
        path: '/Admin/ModifyPassword/index',
        component: '@/pages/Admin/ModifyPassword',
        name: '管理员修改密码',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-项目组管理`,
        path: '/Admin/GroupManager',
        component: '@/pages/Admin/GroupManager',
        name: '项目组管理',
        key: 'index',
      },
      /*项目组管理——查看已结业 */
      {
        title: `${WEB_NAME}-项目组管理`,
        path: '/Admin/GroupManager/Graduated',
        component: '@/pages/Admin/GroupManager/Graduated',
        name: '项目组管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-课程管理`,
        path: '/Admin/CourseAdmin/index',
        component: '@/pages/Admin/CourseAdmin/index',
        name: '课程管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-服务器异常`,
        path: '/500',
        component: '@/pages/500',
        name: '500',
        key: '500',
      },
      {
        title: `${WEB_NAME}-未授权的访问`,
        path: '/403',
        component: '@/pages/403',
        name: '403',
        key: '403',
      },
    ],
  },
  /**
   * 教师
   */
  {
    path: '/Teacher',
    component: '@/layouts/Teacher/index',
    routes: [
      {
        title: `${WEB_NAME}-课程管理`,
        path: '/Teacher/Course',
        component: '@/pages/Teacher/Course/index',
        name: '课程管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-请假管理`,
        path: '/Teacher/Leave',
        component: '@/pages/Teacher/Leave/index',
        name: '请假管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-作业管理`,
        path: '/Teacher/Assignment/Issue/index',
        component: '@/pages/Teacher/Assignment/Issue/index',
        name: '作业管理',
        key: 'index',
      },

      {
        title: `${WEB_NAME}-作业管理`,
        path: '/Teacher/Assignment/Approval/index',
        component: '@/pages/Teacher/Assignment/Approval/index',
        name: '作业管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-服务器异常`,
        path: '/500',
        component: '@/pages/500',
        name: '500',
        key: '500',
      },
      {
        title: `${WEB_NAME}-未授权的访问`,
        path: '/403',
        component: '@/pages/403',
        name: '403',
        key: '403',
      },
    ],
  },

  /*学生端 */
  {
    path: '/Student',
    component: '@/layouts/Student/index',
    routes: [
      {
        title: `${WEB_NAME}-个人信息管理`,
        path: '/Student/PersonalManagement/index',
        component: '@/pages/Student/PersonalManagement/index',
        name: '个人信息管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-作业管理`,
        path: '/Student/TaskManagement/index',
        component: '@/pages/Student/TaskManagement/index',
        name: '作业管理',
        key: 'index',
      },
      //答题
      {
        title: `${WEB_NAME}-作业管理`,
        path: '/Student/TaskManagement/StudentAnswer',
        component: '@/pages/Student/TaskManagement/StudentAnswer',
        name: '作业管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-教师修改密码`,
        path: '/Teacher/Modify/index',
        component: '@/pages/Teacher/Modify',
        name: '教师修改密码',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-服务器异常`,
        path: '/500',
        component: '@/pages/500',
        name: '500',
        key: '500',
      },
      {
        title: `${WEB_NAME}-未授权的访问`,
        path: '/403',
        component: '@/pages/403',
        name: '403',
        key: '403',
      },
    ],
  },
  /*学生端 */
  {
    path: '/Student',
    component: '@/layouts/Student/index',
    routes: [
      {
        title: `${WEB_NAME}-个人信息管理`,
        path: '/Student/PersonalManagement/index',
        component: '@/pages/Student/PersonalManagement/index',
        name: '个人信息管理',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-作业管理`,
        path: '/Student/TaskManagement/index',
        component: '@/pages/Student/TaskManagement/index',
        name: '作业管理',
        key: 'index',
      },
      //答题
      // {
      //   title: `${WEB_NAME}-作业管理`,
      //   path: '/Student/TaskManagement/StudentAnswer',
      //   component: '@/pages/Student/TaskManagement/StudentAnswer',
      //   name: '作业管理',
      //   key: 'index',
      // },
      {
        title: `${WEB_NAME}-学生修改密码`,
        path: '/Student/ModifyPassword/index',
        component: '@/pages/Student/ModifyPassword',
        name: '学生修改密码',
        key: 'index',
      },
      {
        title: `${WEB_NAME}-服务器异常`,
        path: '/500',
        component: '@/pages/500',
        name: '500',
        key: '500',
      },
      {
        title: `${WEB_NAME}-未授权的访问`,
        path: '/403',
        component: '@/pages/403',
        name: '403',
        key: '403',
      },
    ],
  },
];
export default routes;
